<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ taglib prefix="s" uri="/struts-tags" %> 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page import="main.org.form.action.FormBP, main.org.form.action.Forms, main.org.model.*, org.compiere.model.*, org.compiere.util.Env" %>
<%@ page import="org.compiere.dsr.DSR_DataCollection" %>


<%
	FormBP fPro = (FormBP) session.getAttribute("formBP");
	MBPMFormCode fCode = new MBPMFormCode(Env.getCtx(), fPro.getBPM_Form_ID(), null);
%>

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Ввод данных по рентабельности проекта</title>
		<link rel="shortcut icon" href="images/logo.png" type="image/jpg" /> 	
		<link type="text/css" href="css/Main.css" rel="stylesheet">
		<%@ include file="/js/JScript.jsp" %>
	</head>
<body>
	<div>
		<div id="back" class="letter">
			<a class="aBack" title="Вернуться назад" href="<s:url action='forms'>
				<s:param name="AD_Client_ID"><%= fPro.getAD_Client_ID() %></s:param>
				<s:param name="AD_Org_ID"><%= fPro.getAD_Org_ID() %></s:param>
				<s:param name="BPM_VersionBudget_ID"><%= fPro.getBPM_VersionBudget_ID() %></s:param>
				<s:param name="BPM_Project_ID"><%= fPro.getBPM_Project_ID() %></s:param>
				<s:param name="AD_User_ID"><%= fPro.getAD_User_ID() %></s:param>
			</s:url>" >
				<img src="images/back.png" />
			</a>
		</div>
		<table width="100%" cellspacing="2" align="center">
			<tr>
				<td scope="col">
				   	<font color="#321818" style="font-family: sans-serif; font-style:italic" size="+2">Выбор проекта</font>
				   	<br/>&nbsp;
				</td>
			</tr>
		</table>
<%
	MBPMProject project = null;
	FormBP fPropertyBP = (FormBP) session.getAttribute("formBP");
	String orgName="";
	if(fPropertyBP != null) {
		project = new MBPMProject(Env.getCtx(), fPropertyBP.getBPM_Project_ID(), null);
		if (fPropertyBP.getAD_Org_ID()==0)
		  orgName="Холдинг Зерде";
		else
		  orgName=new MOrg(Env.getCtx(), fPropertyBP.getAD_Org_ID(), null).getName();
	}	
%>		
<table width="60%" cellspacing="2" style="margin-left: 150px;">
	<tr>
		<td width="20%" style="border:double; border-color:#8DB3DC; text-align: left; padding-left: 10px;">
	 		<font color="#321818" style="font-family: sans-serif; font-style:normal;" size="+1">Организация</font>
	 	</td>
	 	<td style="border:dotted; border-color:#999999; width:40%; text-align: left; padding-left: 10px;">
	 		<b><%= orgName %></b>
	 	</td>
	</tr>
	<tr>
	 	<td style="border:double; border-color:#8DB3DC; text-align: left; padding-left: 10px;">
	 		<font color="#321818" style="font-family: sans-serif; font-style:normal;" size="+1">Рабочий проект</font>
	 	</td>
	 	<td style="border:dotted; border-color:#999999; text-align: left; padding-left: 10px;">
	 		<b><%= project.getName() %></b>
	 	</td>
	</tr>
</table>

		
		<s:form id="myFormPro">
		<table width="60%" cellspacing="2" style="margin-left: 150px;">
			<tr>
			 	<td width="20%" style="border:double; border-color:#F18800; text-align: left; padding-left: 10px;">
			 		<font color="#321818" style="font-family: sans-serif; font-style:normal;" size="+1">Форма</font>
			 	</td>
			 	<td style="border:dotted; border-color:#999999; width:40%; text-align: left; padding-left: 10px;">
			 		<b><%= fCode.getName() %></b>
			 	</td>
			</tr>
			<tr>
			 	<td style="border:double; border-color:#F18800; text-align: left; padding-left: 10px;">
			 		<font color="#321818" style="font-family: sans-serif; font-style:normal;" size="+1">Проект</font>
			 	</td>
			 	<td style="border:dotted; border-color:#999999; text-align: left; padding-left: 10px;">
			 		<table>
			 		<s:set var="prValue"><%= fPropertyBP.getBPM_Project_ID() %></s:set>
			 		<s:select name="ProjectSubID" headerKey="-1" headerValue="Выбор проекта" style="width: 300px;" 
			 					id="ProjectSubID" list="projectList" value="%{#prValue}"/> 
					</table>
			 	</td>
			</tr>
			<tr>
				<th style="border:double; border-color:#F18800; text-align: center; padding-left: 10px;" bgcolor="#E6F0FA" colspan="2" height="40px;">
					<input type="button" class="button btn-large-green" value="Перейти к форме ввода" onclick="selectProject('selectProject')"/>
					<input type="hidden" name="BPM_Form_ID" value=<%= fPro.getBPM_Form_ID() %> />
					<input type="hidden" name="BPM_FormCode_ID" value=<%= fCode.getBPM_FormCode_ID() %> />
					<input type="hidden" name="AD_Org_ID" value=<%= fPro.getAD_Org_ID() %> />
					<input type="hidden" name="BPM_Project_ID" value=<%= fPro.getBPM_Project_ID() %> />
					<input type="hidden" name="AD_User_ID" value=<%= fPro.getAD_User_ID() %> />
				</th>
			</tr>
		</table>
		</s:form>
	</div>
</body>
</html>